BEGIN {
	print "digraph finite_state_machine {";
}

{
	dobjId = $1;
	time = $2;
	eventName = $3;
	nodeSrc = $4;
	nodeDst = $5;
		
	if (dobjId != dobjCurrent || nodeSrc != srcCurrent) {
		dobjCurrent = dobjId;
		srcCurrent = nodeSrc;
		recTime = 0;
	}
	if (eventName == "EVENT_TYPE_DATAOBJECT_NEW" && recTime == 0) {
		recTime = time;
	}
	if (eventName == "EVENT_TYPE_DATAOBJECT_SEND_SUCCESSFUL") {
		print "\"" substr(nodeSrc,0,2) "-" substr(dobjId,0,4) "\"" , "->" , "\"" substr(nodeDst,0,2) "-" substr(dobjId,0,4) "\"", "[ label = \"" time-recTime "\" ]";
	}
}
END {
	print "}";
}
